home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / Implementation / DocShell / ShellDef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-13  |  16.3 KB  |  458 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ShellDef.h
  3.  
  4.     Contains:    All non-local definitions for the "shell," meaning not
  5.     only the DocShell, but also DraftWindow and the launcher.  The impetus
  6.     for combining previously separate files is to avoid resource id conflicts
  7.     within the shell subsystem and between it an the rest of OpenDoc
  8.     
  9.     Merged from: DfWinDef.h, ODXDef.h, and RlShlDef.h
  10.  
  11.     Owned by: Nick Pilch
  12.  
  13.     Copyright:    © 1994 - 1997 by Apple Computer, Inc., all rights reserved.
  14.  
  15.     Change History (most recent first):
  16.  
  17.         <24>     1/13/97    DH        Minimum and default document heap size
  18.                                     increased to 384K.
  19.         <23>      1/8/97    DH        1401434: New strings for System process to
  20.                                     alert user that document is missing.
  21.         <22>      12/18/96    DH        1375780,1612023: Added new dialog constants
  22.                                     and reordered many others.
  23.         <21>      10/22/96    DH        1336808,1333949,1368888,1375780
  24.                                     Added/changed constants for low mem dialog
  25.                                     and alert resources.
  26.         <20>    02.10.1996    NP        1391011: hard-coded strings, and general
  27.                                     clean-up.
  28.         <19>    27.09.1996    NP        1385775: Incorrect dialog after OD
  29.                                     initialization fails.
  30.         <18>    11.09.1996    NP        1386084: constant for earliest compatible
  31.                                     system version
  32.         <17>      9/4/96    EL        1306385: Remove user item that are used as
  33.                                     default button in dialog.
  34.         <16>     7/30/96    eeh        1372943: kODAlertShellGenericError and
  35.                                     kODAlertShellCorruptDocError
  36.         <15>    17.07.1996    NP        1369268: Change app heap size.
  37.         <14>     6/27/96    TJ        Removed editor type, now using CFMtype for
  38.                                     system headers.
  39.         <13>     6/23/96    NP        10002: Launch time speedups.
  40.         <12>     6/21/96    jpa        T10002: Changed min/default heap size to
  41.                                     210k. 1358818: Added rsrc ID for File menu.
  42.         <11>     6/21/96    eeh        task 10008: add buttons etc. for AppleGuide
  43.         <10>     6/19/96    NP        10002: Launch time speedups.
  44.          <9>     6/18/96    NP        10002: Launch time speedups.
  45.          <8>     6/14/96    NP        10002: Launch time speedups
  46.          <7>    .06.1996    NP        10002: Launch time fixes, system process.
  47.          <6>     5/31/96    jpa        T10012: Added Quit menu cmd for CyberDog
  48.                                     (does not appear in regular docs!)
  49.          <5>    .04.1996    NP        1286751: Present alert when trying to use
  50.                                     Open… when no Finder is running.
  51.          <4>     4/15/96    TJ        Nolonger include ODXDef.h
  52.          <3>     3/29/96    DM        1334273: rsrc const for new alert 493
  53.          <2>    .03.1996    NP        1307182: Removed STR# index constant.
  54.          <4>    10/31/95    TJ        Made the Splash Screen Non-Modal.#1297413
  55.          <3>    10/26/95    TÇ        1296574 GM:Cannot set default memory
  56.                                     partition size.
  57.          <2>    10/24/95    jpa        1293441: Added more SpaceIsLow alerts.
  58.          <1>     9/29/95    eeh        1287262: first checked in
  59.     
  60.     In Progress:
  61.         
  62.         NP: We only have to have unique resource numbers for resources of the
  63.         same kind. Currently, every resource is given a new unique number here.
  64.         We are going to run out of numbers in our range if we don't change the
  65.         scheme.
  66.  
  67.         LDEFs can have the same ID as anything, since having that ID means
  68.         nothing.  (That is, there's no assumption in the code or toolbox like
  69.         the one that DLOG and DITL ids will match.)
  70.         
  71. */
  72.  
  73. #ifndef _SHELLDEF_
  74. #define _SHELLDEF_
  75.  
  76. #ifndef _RSRCBASE_
  77. #include "RsrcBase.h"
  78. #endif
  79.  
  80.  
  81. #define SUPPORT_QUIT    /* Define to add Quit cmd for APPL processes only, *not* documents */
  82.  
  83. #ifdef SUPPORT_QUIT
  84. #define kODCommandQuit    (kODCommandPrint + 1)    /*//jpa $$$$$ Should be in CmdDef.idl*/
  85. /* CyberDog uses the value of this constant so don't mess with it unnecessarily */
  86. #endif
  87.  
  88.  
  89. #define kODShellLDEFRsrcBase    kODShellRsrcBase
  90.  
  91. /*****************************************************************************
  92.     From:        RlShlDef.h
  93.     The constants following are for the DocShell itself
  94. *****************************************************************************/
  95.  
  96. //==============================================================================
  97. // Resources
  98. //==============================================================================
  99.  
  100. //------------------------------------------------------------------------------
  101. // MENU
  102. //------------------------------------------------------------------------------
  103.  
  104. // File menu to use instead of Document menu in 'APPL' process:
  105. #define kODFileMenuID                    (kODShellRsrcBase + 0)
  106.  
  107. #define kSHLSaCKindPopupMenu              (kODShellRsrcBase + 14)
  108.  
  109. //------------------------------------------------------------------------------
  110. // ALRT, DLOG and associated DITL
  111. //------------------------------------------------------------------------------
  112.  
  113. /*The Splash Screen Dialog ID */
  114. #define kODSplashDlogID                    131
  115.  
  116. // Do you want to save changes before closing? DLOG
  117. #define    kSHLsvChanges                    (kODShellRsrcBase + 0)                
  118.  
  119. // Revert to the last saved version? DLOG
  120. #define    kSHLsvRevert                    (kODShellRsrcBase + 1)                    
  121.  
  122. // Delete this document? DLOG
  123. #define    kSHLDeleteDLOG                    (kODShellRsrcBase + 2)                    
  124.  
  125. // Error Handling ALRT
  126. #define    kSHLphGenError                    (kODShellRsrcBase + 3)
  127.  
  128. // Low-memory ALRTs:
  129. // This next two alerts also used for the R/O case.
  130. #define    kSHLphTempMemIsLow                (kODShellRsrcBase + 7)
  131. #define    kSHLphTempMemIsLowFatal            (kODShellRsrcBase + 9)
  132.  
  133. #define    kSHLphAppSpaceIsLow                (kODShellRsrcBase + 10)
  134. #define    kSHLphAppSpaceIsLowRO            (kODShellRsrcBase + 15)
  135. #define    kSHLphAppSpaceIsLowFatal        (kODShellRsrcBase + 14) 
  136. #define    kSHLphAppSpaceIsLowFatalRO        (kODShellRsrcBase + 13) 
  137.  
  138. #define    kSHLphDocSizeChange                (kODShellRsrcBase + 16) 
  139. #define    kSHLphDocSizeChangeRO            (kODShellRsrcBase + 17) 
  140.  
  141. // Low memory dialogs
  142. #define    kSHLphAppSpaceIsLowDlg            (kODShellRsrcBase + 12)
  143.  
  144. #define kSHLAlertCantMakeStationery        (kODShellRsrcBase + 6)
  145.  
  146. // Save A Copy dialog
  147. #define kSHLSaveCopyDlgID                (kODShellRsrcBase + 11)
  148.  
  149. #define kSHLSaCDocumentRadioBtn           13
  150. #define kSHLSaCStationeryRadioBtn         14
  151. #define kSHLSaCKindPopupItem              15
  152. #define kSHLSaCDocumentIconItem           16
  153. #define kSHLSaCStationeryIconItem         17
  154.  
  155. // Save To Different Volume dialog
  156. #define kSHLSaveDiffVolDialogID            (kODShellRsrcBase + 27)
  157.  
  158. #define    kSHLAboutBoxDlogID                (kODShellRsrcBase + 28)
  159.  
  160. // ALRT resource IDs
  161. #define kODXErrAlert                     (kODShellRsrcBase + 29)
  162. #define    kODXAnonErrAlert                (kODShellRsrcBase + 30)
  163.  
  164. #define kDraftsDlgID                    (kODShellRsrcBase + 34)
  165.  
  166. /* fields in Drafts dialog */
  167. #define kDraftsCreateBtn            1
  168. #define kDraftsDoneBtn                2
  169. #define kDraftsDeleteBtn            3
  170. #define kDraftsOpenBtn                4
  171. #define kDraftsCreatorStaticTxt        5
  172. #define kDraftsDraftStaticTxt        6
  173. #define kDraftsCreatedStaticTxt        7
  174. #define kDraftsArrowStaticTxt        8            /* a null string */
  175. #define kDraftsCommentStaticTxt        9
  176. #define kDraftsHeaderRectUserItem    10
  177. #define kDraftsHorizRectUserItem    11
  178. #define kDraftsListUserItem            12
  179. #define kDraftsAGButtonItem            13
  180.  
  181. #define kCreateDraftsDlgID                (kODShellRsrcBase + 35)
  182.  
  183. /* fields in Create Drafts dialog */
  184. #define kCreateDraftsCreateBtn            1
  185. #define kCreateDraftsCancelBtn            2
  186. #define kCreateDraftsDraftStaticTxt        3
  187. #define kCreateDraftsNameStaticTxt        4
  188. #define kCreateDraftsNameEditTxt        5
  189. #define kCreateDraftsCommentsStaticTxt    6
  190. #define kCreateDraftsCommentsEditTxt    7
  191. #define kCreateDraftsDraftEditTxt        8
  192. #define kCreateDraftsAGButtonItem        9
  193.  
  194. #define kDeleteDraftsDlogID                (kODShellRsrcBase + 36)
  195.  
  196. /* fields in Delete Drafts dialog */
  197. #define kDeleteDraftsDeleteBtn            1
  198. #define kDeleteDraftsCancelBtn            2
  199. #define kDeleteDraftsStaticTxt            3
  200.  
  201. #define kODAlertShellLowMemoryError        (kODShellRsrcBase + 43)
  202.  
  203. #define    kODXDoubleClickAlert            (kODShellRsrcBase + 44)
  204.  
  205. #define kODAlertShellFinderNotRunning    (kODShellRsrcBase + 45)
  206.  
  207. #define kODAlertShellGenericError        (kODShellRsrcBase + 46)
  208. #define kODAlertShellCorruptDocError    (kODShellRsrcBase + 47)    
  209.  
  210. //------------------------------------------------------------------------------
  211. // errs
  212. //------------------------------------------------------------------------------
  213.  
  214. // Error Handling errs & STR#
  215. #define    kODErrUserID                    (kODShellRsrcBase + 6)
  216. #define    kODErrSupportID                    (kODShellRsrcBase + 7)
  217.  
  218. //------------------------------------------------------------------------------
  219. // STR#
  220. //------------------------------------------------------------------------------
  221.  
  222. #define kODSysProcStringsID                (kODShellRsrcBase + 0) 
  223. // not used here. See SPDefs.h. Put here in order to reserve this number
  224. //    in the shell's range.
  225.  
  226. #define kODSPStrIndexComplexErrMssg        1
  227. #define kODSPStrIndexTwoPartErrMssg        2
  228. #define kODSPStrIndexOnePartErrMssg        3
  229. #define kODSPStrIndexWrongVersSys        4
  230. #define kODSPStrIndexNoMemoryToStartUp    5
  231. #define kODSPStrIndexUnrecoverableStartUpError    6
  232. #define kODSPStrIndexCouldntRelaunchDoc    7
  233. #define kODSPStrIndexMissingDocument    8
  234.  
  235. //#define kODSPStrIndexVerySimpleErrMssg    xx
  236.  
  237. #define    kODErrUserIDStrings                (kODShellRsrcBase + 8)
  238. #define    kODErrSupportIDStrings            (kODShellRsrcBase + 9)
  239.  
  240. // Dragged-to-Trash alert [DISABLED]
  241. // #define kSHLDragToTrashAlert            (kODShellRsrcBase + 10)
  242.  
  243. // Shell Strings STR#
  244. #define kSHLStrsID                        (kODShellRsrcBase + 19)
  245. //#define kSHLStrIndAboutOD                1
  246. // #define kSHLStrIndMClose                2
  247. // #define kSHLStrIndMCloseDoc            3
  248. #define kSHLStrIndMPartInfo                2
  249. #define kSHLStrIndDSaveACopy            3
  250. #define kSHLStrIndDException            4
  251. #define kSHLStrIndDSaveAs                5
  252.  
  253. // Strings for the Launcher
  254. #define    kODXLibsFldrStrID                (kODShellRsrcBase + 32)
  255. #define kODXLibsFldrStrIndex            1
  256. #define kODXTriedToOpenPrefsStrIndex    2
  257.  
  258. #define kLaunchFailedErrStrings            (kODShellRsrcBase + 33)
  259.  
  260. // STR#-misc errors
  261. #define kSHLMiscErrorStringsStrID        (kODShellRsrcBase + 48)
  262. #define kSHLCannotRunUnderMacOS8Index    1
  263.  
  264. // Doc size change strings
  265. #define kSHLDecreaseSizeSTR                (kODShellRsrcBase + 27)
  266. #define kSHLIncreaseSizeSTR                (kODShellRsrcBase + 28)
  267.  
  268. //------------------------------------------------------------------------------
  269. // STR
  270. //------------------------------------------------------------------------------
  271.  
  272. #define kODSPStrCannotOpenRODocSizeErrMsg    (kODShellRsrcBase + 0) 
  273. // not used here. See SPDefs.h. Put here in order to reserve this number
  274. //    in the shell's range.
  275.  
  276. #define kSHLsvChangesCmdKeyStrs            kSHLsvChanges
  277. #define kSHLsvRevertCmdKeyStrs            kSHLsvRevert
  278. #define kSHLDeleteDLOGCmdKeyStrs        kSHLDeleteDLOG
  279.  
  280. // Folder Name strings searching
  281. #define kODEditorsFldrStrID                (kODShellRsrcBase + 15)
  282. #define kODOpenDocPartsFolderStrID        (kODShellRsrcBase + 16)
  283. #define kODShellPlugInFolderStrID        (kODShellRsrcBase + 17)
  284. #define kODStationeryFldrStrID            (kODShellRsrcBase + 18)
  285.  
  286. // Shell default save a copy string
  287. #define kSHLCopyDefaultStrID            (kODShellRsrcBase + 20)                    
  288.  
  289. // Shell opening pre-OD document name string
  290. #define kSHLPreODDocNameStrID            (kODShellRsrcBase + 21)
  291.  
  292. // Shell new filename construction template
  293. #define kSHLNewFilenameTemplateStrID    (kODShellRsrcBase + 22)
  294.  
  295. // Shell menuitem text construction templates
  296. #define kSHLSaveItemTemplateStrID        (kODShellRsrcBase + 23)
  297. #define kSHLCloseItemTemplateStrID        (kODShellRsrcBase + 24)
  298. #define kSHLDeleteItemTemplateStrID        (kODShellRsrcBase + 25)
  299.  
  300. #define kSHLPlugInErrorStrID            (kODShellRsrcBase + 26)
  301.  
  302. // Prefs file name resource ID
  303. #define kSHLPrefsFileNameResID            (kODShellRsrcBase + 31)
  304.  
  305. #define kDraftsWnTitleResID                (kODShellRsrcBase + 37)
  306. #define kDraftsWnDateSpaceResID            (kODShellRsrcBase + 38)
  307.  
  308. #define kDraftsCmdKeyStrs                (kODShellRsrcBase + 39)
  309. #define kDraftsCreateCmdKeyStrs            (kODShellRsrcBase + 40)
  310.  
  311. #define kSHLPrefsFolderNameResID        (kODShellRsrcBase + 43)
  312. #define kSHLLauncherNameResID            (kODShellRsrcBase + 46)
  313. #define kSHLSystemProcessNameResID        (kODShellRsrcBase + 47)
  314. #define kSHLOldLauncherNameResID        (kODShellRsrcBase + 49)
  315.  
  316. //------------------------------------------------------------------------------
  317. // ICON
  318. //------------------------------------------------------------------------------
  319.  
  320. // Save A Copy dialog
  321. #define kSHLSaCDocumentIconID               (kODShellRsrcBase + 12)
  322. #define kSHLSaCStationeryIconID           (kODShellRsrcBase + 13)
  323.  
  324. //------------------------------------------------------------------------------
  325. // ics#, ics4, ics8
  326. //------------------------------------------------------------------------------
  327.  
  328. #define    kDWClosedTriangleResID        (kODShellRsrcBase + 41)
  329. #define    kDWOpenTriangleResID        (kODShellRsrcBase + 42)
  330.  
  331. //------------------------------------------------------------------------------
  332. // LDEF
  333. //------------------------------------------------------------------------------
  334.  
  335. #define kDraftWinLDEFID            (kODShellLDEFRsrcBase + 0)        
  336. #define kDraftWinLDEFAddrOffset    0x00000008
  337. #define kDWNumColumns 4
  338.  
  339. //==============================================================================
  340. // Error Codes
  341. //==============================================================================
  342.  
  343. // Private error codes. Before adding more, check ErrorDef.idl to ensure uniqueness.
  344. #define kODErrAllWritableVolumesAreFull           -29826
  345. #define kODErrVolumesIsFull                       -29825
  346. #define kODErrDirectoryNotHaveWriteAccess          -29824
  347. #define kODErrCannotSaveACopyOntoCurrentDoc     -29823
  348. #define kODErrCannotSaveACopyOntoBusyDoc          -29822
  349. #define kODErrSystemVolumeIsFull                   -29821
  350. #define kODErrCouldNotBindForeignDocument        -29820
  351. #define kODErrCannotFindShellPlugInsFolder        -29819
  352. #define kODErrCannotFindSystemEditorsFolder        -29818
  353. #define kODErrCannotFindOpenDocLibrariesFolder    -29817
  354. #define    kODErrEditorLibraryNotFound                -29816
  355. #define kODErrCannotSaveAsOntoBusyDoc            -29815
  356.  
  357. //==============================================================================
  358. // Resource types and IDs
  359. //==============================================================================
  360.  
  361. #define kPrefFileType        'pref'
  362. // for stationery creation
  363. #define    kDocSeedResType        'seed'
  364. #define    kDocSeedResID        1
  365.  
  366. // Document Stub Data                    Document Stub App
  367. // kDocStubRsrcType kDocStubRsrcID0        kcfrgRsrcType    kcfrgID
  368. // kDocStubRsrcType kDocStubRsrcID1        kMainCFMType    kMainCFMPPCID
  369. // kDocStubRsrcType kDocStubRsrcID2        kscszRsrcType    kscszID
  370. // kDocStubRsrcType kDocStubRsrcID3        kMainCFMType     kMainCFM68KID
  371. // kDocStubRsrcType kDocStubRsrcID4        kMainCFMType     kMainCFM68KID1
  372. // kDocStubRsrcType kDocStubRsrcID5        kCODERsrcType    kCODEID0
  373. // kDocStubRsrcType kDocStubRsrcID6        kCODERsrcType     kCODEID1
  374. // kDocStubRsrcType kDocStubRsrcID7        kCODERsrcType    kCODEID6
  375. // kDocStubRsrcType kDocStubRsrcID8        kCODERsrcType     kCODEID7
  376. // kDocStubRsrcType kDocStubRsrcID9        kMainCFMType     kSOMMemCFM68KID
  377. // kDocStubRsrcType kDocStubRsrcID10    kMainCFMType     kSOMMemCFMPPCID
  378. // kSIZERsrcType     kDocStubSIZEID        kSIZERsrcType    kSIZEID
  379. //
  380.  
  381. // for document stub data (e.g. types & ids of the doc stub app resources when stored
  382. // in OpenDoc™ & OpenDoc Shell)
  383. #define    kSIZERsrcType        'SIZE'
  384. #define kDocStubSIZEID        3
  385.  
  386. // Default SIZE ID for use if there is no prefs file:
  387. #define kDocStubDefaultSIZEID    4
  388.  
  389. #define kDocStubRsrcType    'DSDT'    // for Document Stub DaTa, i.e. how these resources
  390.                                     // are actually stored in OpenDoc™ & OpenDoc Shell
  391.                                     // except for the SIZE resource which we keep as
  392.                                     // a SIZE resource for the convenience of editing it
  393.                                     // in Resedit.
  394.                                     
  395. #define kDocStubRsrcID0        0
  396. #define kDocStubRsrcID1        1
  397. #define kDocStubRsrcID2        2
  398. #define kDocStubRsrcID3        3
  399. #define    kDocStubRsrcID4        4
  400. #define    kDocStubRsrcID5        5
  401. #define    kDocStubRsrcID6        6
  402. #define    kDocStubRsrcID7        7
  403. #define    kDocStubRsrcID8        8
  404. #define    kDocStubRsrcID9        9
  405. //#define    kDocStubRsrcID10    10
  406.  
  407. // for document stub construction
  408. #define    kMainCFMType        'rseg'  // used to be 'DSTB' for Document STuB
  409.                                     // but CFM68K uses 'rseg'.
  410. #define    kMainCFM68KID        0
  411. #define    kMainCFM68KID1        1
  412. #define    kMainCFMPPCID        2
  413. #define kSOMMemCFM68KID        3
  414. #define kSOMMemCFMPPCID        4
  415.  
  416. #define kcfrgRsrcType        'cfrg'
  417. #define kcfrgID                0
  418. #define    kscszRsrcType        'scsz'
  419. #define kscszID                0
  420.  
  421. #define kDocStubStackSize    (64 * 1024)        // 64K stack size
  422.  
  423. // 1242449 Should probably create a common ≈def.h constant kDocStubMinHeapSize
  424. // accessible from both subsystems. NP: Something like ODDefs.h.
  425. #define    kDocStubMinHeapSize    (384 * 1024)    // min heap size;was 320K (Changed 1/13/97 - dh)
  426. #define    kDocStubDefaultSize    (384 * 1024)    // default app heap; was 256K 
  427.  
  428. #define kCODERsrcType        'CODE'
  429. #define kCODEID0            0
  430. #define kCODEID1            1
  431. #define kCODEID6            6
  432. //#define kCODEID7            7
  433.  
  434. #define    kSIZEID                -1
  435.  
  436. #define kODSystemProcessSignature 'odbg'
  437. #define kODDisabledProcessSignature 'odno'
  438.  
  439. //==============================================================================
  440. // Apple event constants
  441. //==============================================================================
  442.  
  443. #define kODReopenDocEventID 'clre'
  444. #define kODFSSpecKeyword
  445. #define kODProcessSerialNumber
  446.  
  447. //==============================================================================
  448. // Misc
  449. //==============================================================================
  450.  
  451. // Keep these two in sync!
  452. #define kOD1pt2EarliestCompatibleSysVersNum 0x753
  453. #define kOD1pt2EarliestCompatibleSysVersStr "7.5.3"
  454.  
  455.  
  456. #endif    /* _SHELLDEF_ */
  457.  
  458.